
from django.db import models
from django.contrib.auth.models import User

#TODO Enforce priority being positive
class Attribute(models.Model):
    name = models.CharField(unique=True, max_length=50)
    priority = models.IntegerField(unique=True)

class UserAttribute(models.Model):
    user = models.ForeignKey(User, related_name = "AttributedUser")
    attribute = models.ForeignKey(Attribute)
    staff = models.ForeignKey(User, related_name = "AssigningStaff")
    datetime = models.DateTimeField(auto_now_add=True)

